package com.pacai.Recursion;

public class Recursion01 {
    public static void main(String[] args) {
        T t = new T();
        t.test(10);
        System.out.println(t.factorial(5));
    }
}

class T {
    public void test(int n) {
        if (n > 2) {
            test(n - 1);
        }
        System.out.println("n = " + n);
    }

    public int factorial(int n){
        if(n == 1){
            return 1;
        }
        return n * factorial(n - 1);
    }
}